<style type="text/css"> 
	.mainAgreeApply{width: 400px;min-height: 200px;}
	.agreeline{width: 100%;height: 30px;display: inline-block;}
	.agreetext1{display: inline-block;width: 90px;line-height: 30px;float: left;}
	.agreetext2{display: inline-block;line-height: 30px;float: left;}
	.agreebtn1{display: inline-block;width: 100px;height: 37px;background: #09A8D2;color: #fff;text-align: center;line-height: 35px;font-size: 16px;border-radius:4px;cursor: pointer;}
	.agreebtn2{display: inline-block;width: 100px;height: 37px;color: #26BBE0;text-align: center;line-height: 35px;font-size: 16px;border-radius:4px;border: 1px solid #26BBE0;margin-left: 10px;cursor: pointer;}
	.dropdown-list.custom-scroll-bar{
		max-height: 50px;
    	overflow-y: scroll;
    	border-bottom: 1px solid gainsboro;
    	padding-bottom: 5px;
	}
</style>
 
	<div class="mainAgreeApply" style="width: 400px;">
	      <div class="agreeline">
	      		<span class="agreetext1">申请人账号：</span>
	      		<span class="agreetext2" style="color:#26BBE0;">${login!}</span>
	      </div>
	       <div class="agreeline">
	      		<span class="agreetext1">申请人姓名：</span>
	      		<span class="agreetext2" style="color:#26BBE0;">${realName!}</span>
	      </div>
	       <div class="agreeline" style="height: 43px;margin-top: 12px;">
	      		<span class="agreetext1" style="line-height: 32px;">所属角色：</span>
	      		<span class="agreetext2">
	      			<select id="demo2" name="roleId">
		 	 			[#list roles as role]
		 	 				<option  value="${role.id!}" [#if roleId?? && role.id==roleId]selected="selected"[/#if]>${role.name!}</option>
		 	 			[/#list]
					</select>
	      		</span>
	      </div>
	       <div class="agreeline" style="margin-top: 45px;">
	      		<span class="agreetext1" style="height: 30px;"></span>
	      		<span class="agreebtn1">确定</span>
	      		<span class="agreebtn2">取消</span>
	      </div>
	</div>
<script type="text/javascript">
$(document).ready(function(){
	var userapply={};
	userapply.userId='${uid}';
	userapply.roleId='${roleId!}';
	userapply.realName='${realName!}';
	var ddl_picture = DropDownList.create({
        select:$('#demo2'),
        attrs:{
            column :100,
            width :300,
			
        }
    });
	ddl_picture.change(function(){
		userapply.roleId=ddl_picture.val();
	});
	$(".agreebtn2").click(function(){
		layer.close(agreeLayerindex);
	})
	$(".agreebtn1").click(function(){
		 var layerIndex;
		 $.ajax({
	         url : 'doAgreeApplyUser',
	         type : 'post',
	         dataType : 'json',
	         contentType : "application/json; charset=utf-8",
	         data:JSON.stringify(userapply),
			 beforeSend : function () {
				 layerIndex = layer.load(1, {
					  shade: [0.1,'#fff'] //0.1透明度的白色背景
					});
	         },
	         success : function(data) {
	        	 if(data.success){
	            	 layer.alert(data.msg,function(){
	            		 location.href='/employee/employeeApply_list';
	            	 });
	             }else{
	            	 layer.alert(data.msg);
	             }
	         },
			 complete : function() {
				layer.close(layerIndex);
			 }
	     })
	 
	})
})
</script>